package com.uinnova.springboot.configuration;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

//相当于@controller+responseBody 自动返回json类型数据
@RestController
public class ConfigurationController {
    @Autowired
    private JailYml jailYml;

//    相当与requestMapping(requestmethod= get)的简写   作用于get请求
    @GetMapping(value="/jail/configuration")
    public JailYml getConfiguationJailYml(){
        JailYml jailYml1 = new JailYml();
        BeanUtils.copyProperties(this.jailYml,jailYml1);
        return jailYml1;
    }

    @GetMapping(value = "/jail/component")
    public JailYml getComponentJailYml(){
        return jailYml;
    }

}
